/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.biodas.jdas.client;

import org.biodas.jdas.exceptions.DASClientException;
import org.biodas.jdas.schema.registrycoordinates.DASCOORDINATESYSTEM;
import org.springframework.web.client.RestTemplate;

/**
 *
 * @author jw12
 */
public class RegistryCoordinatesClient {
    RestTemplate restTemp=new RestTemplate();
    public static final String PUBLIC_REGISTRY_URL="http://www.dasregistry.org/das/coordinatesystem";
    
    public DASCOORDINATESYSTEM getCoordinatesFromRegistry() throws DASClientException{
        return this.getCoordinatesFromRegistry(PUBLIC_REGISTRY_URL);
    }
    /**
    * Get all coordinates known in the registry for a registry other than the one public one at www.dasregistry.org/das/coordinatesystems
    * @param registryCoordsUrl e.g. http://www.dasregistry.org/das/coordinatesystems
    * @return 
    */
   public DASCOORDINATESYSTEM getCoordinatesFromRegistry(String registryCoordsUrl) throws DASClientException{
      return restTemp.getForObject(registryCoordsUrl, DASCOORDINATESYSTEM.class);
   }
}
